<%@ page language="java" contentType="text/html; charset=utf-8"
         pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>Insert title here</title>
  <link href="bootstrap/css/bootstrap.css" rel="stylesheet"/>
  <link href="bootstrap/css/login.css" rel="stylesheet"/>
  <script type="text/javascript">
  function login() {
    var qq = document.getElementById("qq").value;
    if(qq==""){
      alert("qq不能为空");
      return
    }
   
    var password = document.getElementById("inputPassword").value;
    if(password==""){
      alert("密码不能为空");
      return
    }
    
    document.getElementById("fid").submit();
    
  }

  </script>
</head>
<body>
<div class="container">
<div align="center">
  <form class="form-signin" id="fid" action="action.jsp" method="post">
  <input type="hidden" value="login" name="m">
    <h2 class="form-signin-heading">WeChat登录</h2>
    <label for="qq" class="sr-only">QQ</label>
    <input type="text" id="qq"  name="qq" class="form-control" placeholder="QQ" required autofocus>
    <label for="inputPassword" class="sr-only">密码</label>
    <input type="password" id="inputPassword" name="password" class="form-control" placeholder="密码" required>
    <button class="btn btn-lg btn-primary btn-block" type="button" onclick="login()">登录</button>
        <a class="btn btn-lg btn-primary btn-block" href="register.jsp"> 注册</a>
         <h2 class="form-signin-heading"><%=request.getAttribute("message")==null?"":request.getAttribute("message") %></h2>
    
  </form>
</div>
</div>
</body>
</body>
</html>